package com.zt.business.vo;

import lombok.Data;

@Data
public class ResponseData {
    private int code;
    private String msg;
    private int count;
    private Object data;
    
    private ResponseData(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    private ResponseData(int code,String msg,Object data){
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    private ResponseData(int code,String msg,Object data,int count){
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.count = count;
    }

    /**
     * 单个信息返回
     * @param msg
     * @return
     */
    public static ResponseData responseErrorData(String msg){
        return new ResponseData(1, msg);
    }

    public static ResponseData responseSuccessData(String msg ,Object data){

        return new ResponseData(0, msg,data);
    }

    public static ResponseData responsePageData(String msg ,Object data,int count){
        return new ResponseData(0, msg,data,count);
    }

}
